package com.cbd.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cbd.pojo.PageBean;
import com.cbd.pojo.RentInfo;
import com.cbd.service.RentInfoService;
import com.cbd.util.IQuantity;

@Controller
public class RentInfoController {
	@Resource(name="rentInfoServiceImpl")
	private RentInfoService rs;
	@RequestMapping(path="cbd/landlady/showAllWaitRent",method=RequestMethod.POST)
	public @ResponseBody PageBean findAllRentInfo(@RequestParam("curPage")String curPage,String ladyID){
		PageBean page = new PageBean();
		page.setPageSize(IQuantity.pageSize);
		page.setCurPage(Integer.parseInt(curPage));
		page = rs.findAllRentInfo(page,Integer.parseInt(ladyID));
		List<RentInfo> list = (List<RentInfo>) page.getList();
		for (RentInfo r : list) {
			r.setPurposes(null);
			r.getPersonalcarport().setLandlady(null);
		}
		return page;
		
	}
}
